

using Portal;

namespace Portal.Web
{
    using System.Web.Mvc;
    
    /// <summary>
    /// 
    /// </summary>
    public class RegisterControllerFactory : IBootstrapperTask
    {
        private readonly IControllerFactory _controllerFactory;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="controllerFactory"></param>
        public RegisterControllerFactory(IControllerFactory controllerFactory)
        {
            Check.Argument.IsNotNull(controllerFactory, "controllerFactory");
            _controllerFactory = controllerFactory;
        }

        /// <summary>
        /// 
        /// </summary>
        public void Execute()
        {
            ControllerBuilder.Current.SetControllerFactory(_controllerFactory);
        }
    }
}